<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script src="./js/03-ajax.js"></script>
  <script>
    // async function get(name) {

    // let get = async function (name) {
    //   return await ajax(`http://localhost:3000/profile?${name}`)
    // }
    // get('lisa').then(user => {
    //   console.log(user)
    // })

    // let p = {
    //   async get(name) {
    //     return await ajax(`http://localhost:3000/profile?${name}`)
    //   }
    // }
    // p.get('lisa').then(user => {
    //   console.log(user)
    // })

    class User{
      async get(name) {
        return await ajax(`http://localhost:3000/profile?${name}`)
      }
    }
    new User().get('lisa').then(user => {
      console.log(user)
    })
  </script>
</body>
</html>